package com.usefullc.demo.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.usefullc.common.enums.ValidTypeEnum;
import com.usefullc.system.entity.BaseEntity;
import com.usefullc.system.service.component.extend.DictField;
import com.usefullc.system.service.component.extend.EnumField;
import com.usefullc.system.validator.UsefulPropertyVerify;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author: Sampson
 * @date: 2020-12-19 17:47
 */
@ApiModel("演示")
@TableName("demo")
@Data
public class Demo extends BaseEntity {


    @UsefulPropertyVerify(required = true,minLen = 3,maxLen = 100)
    @ApiModelProperty(notes = "名称")
    private String name;


    @UsefulPropertyVerify(minLen = 3,maxLen = 1000)
    @ApiModelProperty(notes = "描述")
    private String content;

    @UsefulPropertyVerify(type= ValidTypeEnum.DIGIT, max = 10)
    @DictField(value = "userStatus")
    @ApiModelProperty(notes = "状态")
    private Integer status;

    @UsefulPropertyVerify(type=ValidTypeEnum.MOBILE)
    @ApiModelProperty(notes = "手机")
    private String mobile;

    @UsefulPropertyVerify(type=ValidTypeEnum.EMAIL)
    @ApiModelProperty(notes = "邮件")
    private String email;

    @EnumField(value = "userGenderEnum")
    @ApiModelProperty(notes = "性别")
    private Integer gender;

    @ApiModelProperty(notes = "生日")
    private Date birthday;


    @UsefulPropertyVerify(type=ValidTypeEnum.URL,maxLen = 200)
    @ApiModelProperty(notes = "头像")
    private String avatar;
}
